//
//  UIBarButtonItem+Extension.m
//  WeiBTest
//
//  Created by Zc_zhou on 15/9/7.
//  Copyright (c) 2015年 Apple. All rights reserved.
//

#import "UIBarButtonItem+Extension.h"

@implementation UIBarButtonItem (Extension)
+(UIBarButtonItem *)itemWithimage:(NSString*)image highImage:(NSString*)highImage target:(id)target action:(SEL)action
{
    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    btn.size = btn.currentBackgroundImage.size;
     return  [[UIBarButtonItem alloc] initWithCustomView:btn];
    
}
@end
